<%@page import="model.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	User u = new User();
	if (!u.isAdmin((String) session.getAttribute("lv"))) {
		response.sendRedirect("../index.jsp");
	}
	Actor actor = new Actor();
	String orby = (String) request.getParameter("sort");
	if (orby != null) {
		if (orby.equals("n"))
			orby = "ac_name";
		if (orby.equals("b"))
			orby = "ac_bio";
	}
	int[] acid = actor.getAcID(orby);
%>
<title>MYFILM - Cat Manage</title>
<div>
	<h2>Manage Categories</h2>
</div>
<table>
	<thead>
		<tr>
			<th><a href="actor.jsp?sort=n">Actor</a></th>
			<th><a href="actor.jsp?sort=b">Bio</a></th>
			<th>Edit</th>
			<th>Delete</th>
		</tr>
	</thead>
	<tbody>
	<tr><td><a href="actor.jsp?site=a">Add</a></td><td></td><td></td><td></td>
		<%
			for (int i:acid) {
				actor = actor.getActor(i);
		%>
		<tr>
			<td><%=actor.getAc_name()%></td>
			<td><%=actor.getAc_bio()%></td>
			
			<td><a class='edit' href='actor.jsp?site=e&acid=<%=i%>'>Edit</a></td>
			<td><a class='delete' href='delete.jsp?acid=<%=i%>'>Delete</a></td>
		</tr>
		<%
			}
		%>
		
	</tbody>
</table>